#pragma once
#include <string>
#include "Map.h"

class GraphBuilder
{
	struct NodeFinder
	{
		std::string sId;
		NodeType tType;

		NodeFinder(std::string s, NodeType tp)
			:sId(s),
			tType(tp)
		{
		}
		bool operator()(Node* n)
		{
			return n->Id == sId && tType == n->Type;
		}
	};
	struct EdgeFinder
	{
		Node *nNode;
		EdgeFinder(Node* n)
			:nNode(n)
		{
		}
		bool operator()(Edge* e)
		{
			return e->data == nNode;
		}
	};

protected:
	GraphBuilder();
	virtual ~GraphBuilder();

	static const double BETA;
	static Node* FindNode(std::list<Node*> &nodes, std::string &sId, NodeType tp);
	static void UpdateGraph(Graph &grp, std::map<Node*, double> &mapWeights,
		Node* nodeStart, Node *nodeEnd,
		double dWeight);
public:
	
	static AdsorptionData* ReadData(std::string &sInputFile);
};